//  spawn译为引起
const childProcess = require('child_process')

for (let i=0;i<3;i++){
    var workerProcess = childProcess.spawn('node',['common.js',i]) 
    workerProcess.stdout.on('data',(data) =>{
        console.log('stdout: ' + data)})
    workerProcess.stderr.on('data',(data) =>{
        console.log('stderr: ' + data)})
    workerProcess.on('colse', function (code) {
        console.log('子进程已退出，退出码 '+code);
    });
}